package org.xxpay.core.entity;

import java.util.Date;

public class AlipayCashDetail extends BaseModel {

    public static final byte STATUS_WAIT = 0; //0-待发放
    public static final byte STATUS_SUCCESS = 1; //1-分账成功
    public static final byte STATUS_FAIL = 2; //2-分账失败
    public static final byte STATUS_CANCEL = 3; //3-已取消发放

    /**
     * ID
     *
     * @mbggenerated
     */
    private Integer id;

    /**
     * 红包记录ID
     *
     * @mbggenerated
     */
    private Integer cashId;

    /**
     * 红包用户
     *
     * @mbggenerated
     */
    private Integer cashUserId;

    /**
     * 支付宝账号快照
     *
     * @mbggenerated
     */
    private String alipayLoginId;

    /**
     * 计划分账金额(平台计算), 单位：分
     *
     * @mbggenerated
     */
    private Long planAmount;

    /**
     * 实际分账金额(接口返回), 单位：分
     *
     * @mbggenerated
     */
    private Long realAmount;

    /**
     * 状态：0-待发放 1-分账成功, 2-分账失败 3-已取消发放
     *
     * @mbggenerated
     */
    private Byte status;

    /**
     * 如分账失败，支付宝返回错误消息
     *
     * @mbggenerated
     */
    private String alipayErrorMsg;

    /**
     * 分账用户所属平台操作员ID, 一般用于操作员查询
     *
     * @mbggenerated
     */
    private Long belongUserId;

    /**
     * 创建时间
     *
     * @mbggenerated
     */
    private Date createTime;

    /**
     * 更新时间
     *
     * @mbggenerated
     */
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCashId() {
        return cashId;
    }

    public void setCashId(Integer cashId) {
        this.cashId = cashId;
    }

    public Integer getCashUserId() {
        return cashUserId;
    }

    public void setCashUserId(Integer cashUserId) {
        this.cashUserId = cashUserId;
    }

    public String getAlipayLoginId() {
        return alipayLoginId;
    }

    public void setAlipayLoginId(String alipayLoginId) {
        this.alipayLoginId = alipayLoginId;
    }

    public Long getPlanAmount() {
        return planAmount;
    }

    public void setPlanAmount(Long planAmount) {
        this.planAmount = planAmount;
    }

    public Long getRealAmount() {
        return realAmount;
    }

    public void setRealAmount(Long realAmount) {
        this.realAmount = realAmount;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public String getAlipayErrorMsg() {
        return alipayErrorMsg;
    }

    public void setAlipayErrorMsg(String alipayErrorMsg) {
        this.alipayErrorMsg = alipayErrorMsg;
    }

    public Long getBelongUserId() {
        return belongUserId;
    }

    public void setBelongUserId(Long belongUserId) {
        this.belongUserId = belongUserId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", cashId=").append(cashId);
        sb.append(", cashUserId=").append(cashUserId);
        sb.append(", alipayLoginId=").append(alipayLoginId);
        sb.append(", planAmount=").append(planAmount);
        sb.append(", realAmount=").append(realAmount);
        sb.append(", status=").append(status);
        sb.append(", alipayErrorMsg=").append(alipayErrorMsg);
        sb.append(", belongUserId=").append(belongUserId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AlipayCashDetail other = (AlipayCashDetail) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getCashId() == null ? other.getCashId() == null : this.getCashId().equals(other.getCashId()))
                && (this.getCashUserId() == null ? other.getCashUserId() == null : this.getCashUserId().equals(other.getCashUserId()))
                && (this.getAlipayLoginId() == null ? other.getAlipayLoginId() == null : this.getAlipayLoginId().equals(other.getAlipayLoginId()))
                && (this.getPlanAmount() == null ? other.getPlanAmount() == null : this.getPlanAmount().equals(other.getPlanAmount()))
                && (this.getRealAmount() == null ? other.getRealAmount() == null : this.getRealAmount().equals(other.getRealAmount()))
                && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
                && (this.getAlipayErrorMsg() == null ? other.getAlipayErrorMsg() == null : this.getAlipayErrorMsg().equals(other.getAlipayErrorMsg()))
                && (this.getBelongUserId() == null ? other.getBelongUserId() == null : this.getBelongUserId().equals(other.getBelongUserId()))
                && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
                && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getCashId() == null) ? 0 : getCashId().hashCode());
        result = prime * result + ((getCashUserId() == null) ? 0 : getCashUserId().hashCode());
        result = prime * result + ((getAlipayLoginId() == null) ? 0 : getAlipayLoginId().hashCode());
        result = prime * result + ((getPlanAmount() == null) ? 0 : getPlanAmount().hashCode());
        result = prime * result + ((getRealAmount() == null) ? 0 : getRealAmount().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getAlipayErrorMsg() == null) ? 0 : getAlipayErrorMsg().hashCode());
        result = prime * result + ((getBelongUserId() == null) ? 0 : getBelongUserId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }
}